﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.SqlClient;
using System.Data;

namespace ConsoleApp11
{
    class Program
    {
        static void Main(string[] args)
        {
            string connectionString = "server=.;database=senlnfo；uid=sa;pwd=zbc200136";
            SqlConnection sqlConnection = new SqlConnection(connectionString);
           sqlConnection.Open();
            

            string sqlcommandString = "select * from Users";
            SqlCommand sqlCmd = new SqlCommand(sqlcommandString, sqlConnection);
            var da = sqlCmd.ExecuteReader();
            
            Console.WriteLine(" 名字+年龄");
            while (da.Read())
            {
                Console.WriteLine(" {0}/t {1}/t", da[1], da[2]);
            }
            sqlConnection.Close();



        }
    }
}

